<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: appHeader"></head>
<body id="history-body" ontouchstart>
<div class="weui-form-preview">
    <div class="weui-form-preview__hd">
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">转序类型</label>
            <b class="weui-form-preview__item" th:if="${sheet.category == 1}">制作件</b>
            <b class="weui-form-preview__item" th:if="${sheet.category == 2}">装配件</b>
            <b class="weui-form-preview__item" th:if="${sheet.category == 3}">返修票</b>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">生产令号</label>
            <b class="weui-form-preview__item" th:text="${sheet.prodNo}"></b>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">图号</label>
            <b class="weui-form-preview__item" th:text="${sheet.drawNo}"></b>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">零件名称</label>
            <b class="weui-form-preview__item" th:text="${sheet.drawName}"></b>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">零件数量</label>
            <b class="weui-form-preview__item" th:text="${sheet.drawNum}"></b>
        </div>
    </div>
    <h2 style="margin-top: 16px;text-align: center" th:if="${list.size() == 0}" th:text="${content}"></h2>
    <div th:each="r : ${list}" style="border-bottom: 1px solid #e5e5e5;">
        <div class="weui-form-preview__bd" onclick="gotoRecDetailPage(this)" th:id="${r.id}">
            <div class="weui-form-preview__item">
                <label class="weui-form-preview__label">转序类型</label>
                <a class="weui-form-preview__item" th:if="${r.type == 1}">制作件</a>
                <a class="weui-form-preview__item" th:if="${r.type == 2}">装配件</a>
                <a class="weui-form-preview__item" th:if="${r.type == 3}">返修票</a>
            </div>
            <div class="weui-form-preview__item">
                <label class="weui-form-preview__label">工艺路线</label>
                <b class="weui-form-preview__item" th:text="${r.route}+'    '+${r.orderNo}"></b>
            </div>
            <div class="weui-form-preview__item" th:if="${r.process != null}">
                <label class="weui-form-preview__label">工艺工序</label>
                <b class="weui-form-preview__item" th:text="${r.process}+'    '+${r.handNo}"></b>
            </div>
        </div>
    </div>
</div>
<div class="weui-tabbar">
    <a th:href="@{/index}" class="weui-tabbar__item weui-bar__item--on">
        <div class="weui-tabbar__icon">
            <img th:src="@{/img/me.png}" alt="">
        </div>
        <p class="weui-tabbar__label">我的信息</p>
    </a>
    <!--生产历史-->
    <a th:if="${#strings.contains(session.user.roles,'【申请质检】')}" th:href="@{/hisApply/null/null}" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img th:src="@{/img/his_apply.png}" alt="">
        </div>
        <p class="weui-tabbar__label">历史申请</p>
    </a>
    <a th:if="${#strings.contains(session.user.roles,'【转序接收】')}" th:href="@{/hisRec/null/null}" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img th:src="@{/img/his_rec.png}" alt="">
        </div>
        <p class="weui-tabbar__label">历史接收</p>
    </a>
    <a th:if="${#strings.contains(session.user.roles,'【转序质检】')}" th:href="@{/hisCheck/null/null}" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img th:src="@{/img/his_check.png}" alt="">
        </div>
        <p class="weui-tabbar__label">历史质检</p>
    </a>
    <a th:if="${#strings.contains(session.user.roles,'【入库质检】')}" onclick="tips()" href="javascript:void(0)" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img th:src="@{/img/his_check.png}" alt="">
        </div>
        <p class="weui-tabbar__label">入库历史质检</p>
    </a>
</div>
<div th:include="include :: appFooter"></div>
<script th:inline="javascript">
    function gotoRecDetailPage(obj){
        let transId = $(obj).attr("id");
        location.href = ctx + "gotoRecDetailPage/"+transId;
    }
    $(function () {
        $('.btn-rec').click(function (e) {
            let $form = $(e.currentTarget).parents("form");
            $.operate.submit({
                url: ctx + 'rec',
                data: new FormData($form[0]),
                fun: function () {
                    location.href = ctx + "index";
                }
            });
        })
    })

</script>
</body>
</html>